home *** CD-ROM | disk | FTP | other *** search
- property pStartDigit, pDay, PHr, pMin, pSec, pThisTime
- global gCountEnd
-
- on new me, startDigit
- set pStartDigit to startDigit
- set pDay to string(12)
- set PHr to string(random(23))
- set pMin to string(random(59))
- set pThisTime to the timer
- adjustTime(me)
- return me
- end
-
- on adjustTime me
- if the number of chars in pDay = 1 then
- put 0 before pDay
- end if
- if the number of chars in PHr = 1 then
- put 0 before PHr
- end if
- if the number of chars in pMin = 1 then
- put 0 before pMin
- end if
- end
-
- on setDisplay me
- if the puppet of sprite pStartDigit = 0 then
- startPuppets(me)
- end if
- set thisSprite to pStartDigit
- repeat with x = 1 to 2
- set thisCast to string(char x of pDay)
- set the member of sprite thisSprite to thisCast
- set thisSprite to thisSprite + 1
- end repeat
- repeat with x = 1 to 2
- set thisCast to string(char x of PHr)
- set the member of sprite thisSprite to thisCast
- set thisSprite to thisSprite + 1
- end repeat
- repeat with x = 1 to 2
- set thisCast to string(char x of pMin)
- set the member of sprite thisSprite to thisCast
- set thisSprite to thisSprite + 1
- end repeat
- updateStage()
- end
-
- on updateDisplay me
- if the timer > (pThisTime + 60) then
- set pThisTime to the timer
- set pDay to value(pDay)
- set PHr to value(PHr)
- set pMin to value(pMin)
- set pMin to pMin - 1
- if (pMin = 0) and (PHr = 0) and (pDay = 0) then
- set gCountEnd to 1
- go(1, "COUNTEND")
- stopEvent()
- exit
- end if
- if pMin = 0 then
- set pMin to 59
- set PHr to PHr - 1
- end if
- if (PHr = 0) and (pDay > 0) then
- set PHr to 59
- set pDay to pDay - 1
- else
- if PHr = 0 then
- nothing()
- end if
- end if
- if pDay < 0 then
- set pDay to 0
- end if
- set pDay to string(pDay)
- set PHr to string(PHr)
- set pMin to string(pMin)
- adjustTime(me)
- setDisplay(me)
- end if
- end
-
- on startPuppets me
- set thisSprite to pStartDigit
- repeat with x = 1 to 6
- puppetSprite(thisSprite, 1)
- set thisSprite to thisSprite + 1
- end repeat
- end
-